// @ts-ignore
/* eslint-disable */

import { oauthRequest } from '@/utils/HttpRequest';
import { request } from 'umi';

/** 发送验证码 POST /api/login/captcha */
export async function getFakeCaptcha(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getFakeCaptchaParams,
  options?: { [key: string]: any },
) {
  return request<API.FakeCaptcha>('/api/oauth/oauth/login/captcha', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 登录接口 POST /api/login/outLogin */
export async function outLogin(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/oauth/oauthlogin/outLogin', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams) {
  return oauthRequest.post<API.BaseDataResult<API.CurrentUser>>(
    '/login/account',
    body,
  );
}

export async function findByLoginList(params?: any) {
  //SwaggerResources

  return oauthRequest.getList<API.LoginLog>('/system/log/login', params);
}
